import 'package:bilibili/http/core/hi_net.dart';
import 'package:bilibili/http/request/home_request.dart';
import 'package:bilibili/http/request/home_video_request.dart';
import 'package:bilibili/model/home_mo.dart';

class HomeDao {
  static get(String categoryName,
      {int pageIndex = 1, int pageSize = 10}) async {
    HomeRequest request = HomeRequest();
    // request.pathParams = categoryName;
    request.add("pageIndex", pageIndex).add("pageSize", pageSize);
    var result = await HiNet.getInstance().fire(request);
    print(result);

    return HomeMo.fromJson(result);
  }

  static getVideo(String categoryName,
      {int pageIndex = 1, int pageSize = 10}) async {
    HomeVideoRequest request = HomeVideoRequest();
    // request.pathParams = categoryName;
    request.add("pageIndex", pageIndex).add("pageSize", pageSize);
    var result = await HiNet.getInstance().fire(request);
    print(result);

    return HomeMo.fromJson(result);
  }
}
